"""
@file: response.py
@author: lingdubing
@time: 2024/10/29  11:09
@desc: 注册返回模型
@character: utf-8
"""

from pydantic import Field, BaseModel


class RegisterModel(BaseModel):
    username: str = Field(..., description="手机号或者邮箱号",
                          pattern=r'^1[3-9]\d{9}$|^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.['
                                  r'a-zA-Z0-9-.]+$')  # 手机号或者邮箱号
    password: str = Field(..., description="密码")
    ver_code: str = Field(..., description="验证码")


class LoginModel(BaseModel):
    username: str = Field(..., description="手机号或者邮箱号",
                          pattern=r'^1[3-9]\d{9}$|^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.['
                                  r'a-zA-Z0-9-.]+$')  # 手机号或者邮箱号
    password: str | None = Field(None, description="密码")
    ver_code: str | None = Field(None, description="验证码")



